﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace ExcelRename.Model
{
    public class DataInfo
    {
        /// <summary>
        /// 物流单号
        /// </summary>
        public string Number { set; get; }
        /// <summary>
        /// 订单号
        /// </summary>
        public string ID { set; get; }
        /// <summary>
        /// 产品数量
        /// </summary>
        public int Count { set; get; }
        /// <summary>
        /// 产品属性
        /// </summary>
        public string Property { set; get; }

        /// <summary>
        /// 品牌
        /// </summary>
        public string Brand
        {
            get
            {
                return Property.Split(',')[1].Trim();
            }
        }
        /// <summary>
        /// 变体
        /// </summary>
        public string Variation
        {
            get
            {
                return Regex.Match(Property, "Variation:(?<value>.+?),").Groups["value"].Value.Trim();
            }
        }
        public bool IsNumber
        {
            get
            {
                return Regex.IsMatch(Variation, "^[0-9]+$");
            }
        }

        /// <summary>
        /// 店铺名称新增字段
        /// </summary>
        public string ShopName { set; get; }
    }
}